﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CapitalizeExtension
{
    static class Extension
    {
        public static string Capitalize(this string value)
        {
            StringBuilder sb = new StringBuilder();
            string[] arr = value.Split(' ');
            foreach (var str in arr)
            {
                if (str.Length == 0) continue;


                sb.Append(str.Substring(0, 1).ToUpper());
                if (str.Length > 1) sb.Append(str.Substring(1));

                sb.Append(' ');
            }
            return sb.ToString();
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("this is a test string".Capitalize());
        }
    }
}
